import fetch from './util/fetch';



/*默认商品列表*/
export function getGoodsList(data) {
  return fetch({
    url: 'goods',
    method: 'get',
    params: data
  });
}
//搜索参数后
export function getGoodsListByParams(data,queryParams,time) {
  return fetch({
    url: 'goods',
    method: 'get',
    params: Object.assign({},data,queryParams,time)
  });
}

//商品上架
export function goodsPutAway(data) {
    return fetch({
        url: 'goods/putaway',
        method: 'patch',
        data:data
    });
}
//商品下架
export function goodsTakeOffByIds(data) {
    return fetch({
        url: 'goods/takeOffByIds',
        method: 'patch',
        data:data
    });
}

//批量删除商品
export function goodsDeleteByIds(data) {
    return fetch({
        url: '/goods/deleteByIds',
        method: 'delete',
        data:data
    });
}

//撤回审核
export function goodsReturnCheck(data) {
    return fetch({
        url: '/goods/cancelCheck',
        method: 'patch',
        data:data
    });
}

//批量设置库存 data数组
export function updateBatch(data) {
    return fetch({
        url:'/goods/specification/combination/updateBatch',
        method:'patch',
        data:data
    })

}
//设置库存 data单个对象
export function updateOneStore(data) {
    return fetch({
        url:'/goods/specification/combination',
        method:'patch',
        data:data
    })

}
//获取商品规格SKU
export function getProSpecis(id,data) {
    return fetch({
        url:'/goods/specification/combination/listByGoodsId/'+id,
        method:'get',
        params:data
    })
}

//获取商品信息
export function getDetail(data) {
    return fetch({
        url:'goods/getGoodsDetail',
        method:'get',
        params:data
    })
}

//调用修改规格以后删除商品的接口
export function deleteSpeciChangedPros(data) {
    return fetch({
        url:'goods/specification/combination/deleteByGoodsId',
        method:'delete',
        params:data
    })
}

//确认修改
export function updateProInfo(data) {
    return fetch({
        url:'/goods/releaseGoodsInfo',
        method:'post',
        data:data
    })
}

//审核通过和未通过
export function getCheckByWeek() {
    return fetch({
        url:'/goods/getCheckByWeek',
        method:'get'
    })
}

//商品导出
export function exportProductsLists(data) {
    return fetch({
        url:'goods/exportGoods',
        method:'get',
        params:data
    })
}